<?php

namespace app\yunda\validate;
use think\Validate;
class Active extends Validate
{
    //定义验证规则
    protected $rule = [
        'icon|奖品图标' => 'require',
        'active_title|奖品说明' => 'require',
        'chance|中奖权重' => 'require|regex:^[1-9]\d*$',
        'stock|库存'  => 'require|regex:^[0-9]\d{0,9}$',

    ];

    //定义验证提示
    protected $message = [
        'chance.regex' => '中奖概率必须为大于0的正整数',
        'stock.regex' => '库存必须是非负整数',

    ];

}
